home *** CD-ROM | disk | FTP | other *** search
/ CICA 1995 August / CICA - The Ultimate Collection of Shareware for Windows (Disc 2) (August 1995).iso / disc2 / programr / atre27.exe / ATREE_27 / EXAMPLE1.LF < prev    next >
Text File  |  1992-08-01  |  4KB  |  119 lines

  1. #
  2. #
  3. #---- example1.lf
  4. #
  5. #
  6. #---- This is an lf example that learns both the XOR, NXOR,
  7. #---- and AND functions of two binary inputs.
  8. #---- The trees are saved into the file example1.tre
  9. #---- The encodings are saved into the file example1.cod
  10. #---- Note that a saved set of trees must be accompanied
  11. #---- by its corresponding encodings if the tree is to function
  12. #---- properly in future trials where the trees are loaded
  13. #---- instead of generated.
  14. #
  15.  
  16. #---- Specify tree statements.
  17. tree
  18.  
  19. #---- Train on trees of 512 leaves.
  20.     size = 512
  21.  
  22. #---- Train until we get 4 elements of the training set right
  23.     min correct  = 4
  24.  
  25. #---- or until 10 epochs have passed.
  26.     max epochs  = 10
  27.  
  28. #---- Output folded trees for later retrieval and evaluation
  29.     save folded tree to "example1.tre"
  30.  
  31. #---- Specify function statements.
  32. function
  33.  
  34. #---- Domain dimension MUST be the first statement, followed
  35. #---- by the codomain dimension statement.
  36.     domain dimension = 2
  37.  
  38. #---- We are training on 3 functions at once, XOR, NXOR, and AND
  39. #---- which means there are 3 codimensions.
  40.     codomain dimension = 3
  41.  
  42. #---- Coding output will be saved for use with the trees we are saving.
  43.     save coding to "example1.cod"
  44.  
  45. #---- All dimensions and codimensions are boolean, so specify
  46. #---- bits:stepsize for the encoding of input and output.
  47.     coding = 1:1 1:1 1:1 1:1 1:1
  48.  
  49. #---- Boolean values have 2 quantization levels.
  50.     quantization = 2 2 2 2 2
  51.  
  52. #---- Optional specifications of the largest values in the 5 encodings;
  53. #---- if not specified, then the largest value in the training and test set
  54. #---- is used.
  55.     largest = 1 1 1 1 1
  56.  
  57. #---- Optional specifications of the smallest values in the 5 encodings;
  58. #---- if not specified, then the smallest value in the training and test set
  59. #---- is used.  
  60. #---- Note that the smallest values may not equal the largest values.
  61.     smallest = 0 0 0 0 0
  62.  
  63. #---- There are four rows in our training set.
  64. training set size = 4
  65. training set =
  66.  
  67. # A B   A xor B A nxor B    A and B
  68.   1 1      0       1           1
  69.   1 0      1       0           0
  70.   0 1      1       0           0
  71.   0 0      0       1           0
  72.  
  73. #---- We will test on the following 4 vectors.
  74. test set size = 4
  75. test set =
  76. # A B   A xor B A nxor B    A and B
  77.   1 1      0       1           1
  78.   1 0      1       0           0
  79.   0 1      1       0           0
  80.   0 0      0       1           0
  81.  
  82. #---- The following output file should be generated:
  83. #---- The first line indicates how many codomains there are.
  84. #---- The next four lines represent each of the four lines in the test set.
  85. #---- Each value is followed by its corresponding quantization number
  86. #---- in the prescribed encoding scheme.  Each codomain is followed
  87. #---- by the corresponding result from the ALN's, along with its quantization 
  88. #---- number.  Remember, it's not the calculated value that is as important
  89. #---- as the calculated quantization level.  You can get more accurate values
  90. #---- by tightening up the encoding: increasing the number of quantization 
  91. #---- levels.
  92.  
  93. #---- After the results is the error histogram, which counts, 
  94. #---- for each of the codomains, the number of times the result quantization 
  95. #---- level differed from the actual quantization level by n.  In this example,
  96. #---- the ALN's executed the test set perfectly, so there are 4 counts for
  97. #---- errors of n = 0 in each of the 3 codomains.
  98.  
  99. #  A            B       A xor B  A xor B result  A nxor B A nxor B result A and B  A and B result
  100.  
  101. #3
  102. #1.000000 1 1.000000 1  0.000000 0  0.000000 0  1.000000 1  1.000000 1  1.000000 1  1.000000 1
  103. #1.000000 1 0.000000 0  1.000000 1  1.000000 1  0.000000 0  0.000000 0  0.000000 0  0.000000 0
  104. #0.000000 0 1.000000 1  1.000000 1  1.000000 1  0.000000 0  0.000000 0  0.000000 0  0.000000 0
  105. #0.000000 0 0.000000 0  0.000000 0  0.000000 0  1.000000 1  1.000000 1  0.000000 0  0.000000 0
  106. #
  107. #ERROR HISTOGRAM
  108. #0 errors   4   4   4
  109. #1 errors   0   0   0
  110. #2 errors   0   0   0
  111. #3 errors   0   0   0
  112. #4 errors   0   0   0
  113. #5 errors   0   0   0
  114. #6 errors   0   0   0
  115. #7 errors   0   0   0
  116. #8 errors   0   0   0
  117. #9+ errors  0   0   0
  118.